package com.ds.lens.data.common.query.es;


public class TermsFunction implements TranslateFunction {
    public static final String NAME = "terms";
    private static final String FIELD_PREFIX = "'field'=";
    private static final String SIZE_PREFIX = "'size'=";
    private static final String ALIAS_PREFIX = "'alias'=";

    @Override
    public void apply(Appendable appender, String... input) throws Exception {
                appender.append(NAME)
                .append("(")
                .append(FIELD_PREFIX)
                .append(input[0])
                .append(",")
                .append(SIZE_PREFIX)
                .append(input[1])
                .append(",")
                .append(ALIAS_PREFIX)
                .append(input[0])
                .append(")");
    }
}
